package me.dengfengdecao.android.photogallery;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 模型对象
 */
public class GalleryItem {

    private String mTitle;          // 图片的标题
    private String mDescription;    // 图片的详细描述
    private String mPicUrl;         // 缩略图地址
    private String mUrl;            // 图片所在网页网址


    // 读取JSON数据
    public GalleryItem(JSONObject json) throws JSONException {
        mTitle = json.getString("title");
        mDescription = json.getString("description");
        mPicUrl = json.getString("picUrl");
        mUrl = json.getString("url");
    }

    @Override
    public String toString() {
        return mTitle;
    }

    public String getTitle() {
        return mTitle;
    }

    public void setTitle(String title) {
        mTitle = title;
    }

    public String getDescription() {
        return mDescription;
    }

    public void setDescription(String description) {
        mDescription = description;
    }

    public String getPicUrl() {
        return mPicUrl;
    }

    public void setPicUrl(String picUrl) {
        mPicUrl = picUrl;
    }

    public String getUrl() {
        return mUrl;
    }

    public void setUrl(String url) {
        mUrl = url;
    }
}
